<%@ page language="java"  pageEncoding="UTF-8"%>
<%@ taglib uri="/struts-tags" prefix="s"%>
<%@ taglib prefix="sx" uri="/struts-dojo-tags" %> 
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
   <head>  
     <title>录入学位论文</title>
	 <meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">
	<link rel="stylesheet" href="../../css/vip.css" type="text/css">
    <script type="text/javascript" src="../../js/showNewDiv.js"></script>
    <link rel="stylesheet" type="text/css" href="../../js/extjs/resources/css/ext-all.css"/>
    <script type="text/javascript" src="../../js/FoshanRen.js"></script>
    <script type="text/javascript" src="../../js/My97DatePicker/WdatePicker.js">
   <script type="text/javascript" charset="utf-8" src="../../js/extjs/adapter/ext/ext-base.js"></script>
    <script type="text/javascript" charset="utf-8" src="../../js/extjs/ext-all.js"></script>
    <script language="javascript">
function len(s){//获取字符串的字节长度
  return s.length+(s.match(/[^\x00-\xff]/g) ||"").length;//加上匹配到的全角字符长度
}
String.prototype.trim=function(){
return this.replace(/(^\s*)|(\s*$)/g,"");
}

function check(){
var reg=/^\d+$/;//判断是非负整数的正则表达式
var LEN400=400,LEN20=20,LEN1000=1000,LEN100=100;
var f,paperTitle,author,tutor,graduateYear,keyWords,thesisAbstract,reviewComments,note;
var year=document.getElementById("graduateYear").value;
var myDate = new Date();
if(year.trim() != ""){
	if(year <= 1980 || year > myDate.getYear())
	{ 
   		alert("年份格式不正确!");
  		return;
	} 
}

paperTitle=document.getElementById("paperTitle").value;
if(paperTitle.trim()==""){
  alert("论文题目不可为空！");
  return;
}
author=document.getElementById("author").value;
if(author.trim()==""){
  alert("论文作者不可为空！");
  return;
}

thesisAbstract=document.getElementById("thesisAbstract").value;
if(thesisAbstract!=""){
  if(len(thesisAbstract)>LEN1000){
  alert("摘要长度超过"+LEN1000+"字节！");
  return;
}
}

reviewComments=document.getElementById("reviewComments").value;
if(reviewComments!=""){
  if(len(reviewComments)>LEN1000){
  alert("评审意见长度超过"+LEN1000+"字节！");
  return;
}
}

note=document.getElementById("note").value;
if(note!=""){
  if(len(note)>LEN100){
  alert("备注长度超过"+LEN100+"字节！");
  return;
}
}

f=document.getElementById("myform");
f.submit();
}
    </script>
  </head> 
  <body bgcolor="#FFFFFF" text="#000000" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
  <s:form id="myform" action="thesisManage_save" namespace="/admin/thesis" enctype="multipart/form-data"  method="post">
  <table id="tables" width="98%" border="0" cellspacing="1" cellpadding="3" align="center">
    <tr bgcolor="6f8ac4"> 
      <td colspan="2" ><font color="#FFFFFF">学位论文录入：</font></td>
    </tr>
    <tr bgcolor="f5f5f5"> 
      <td width="25%"> <div align="right">论文题目：</div></td>
      <td width="75%"><s:textfield id="paperTitle" name="thesis.paperTitle" size="60" maxlength="400"/><font color="#FF0000">*</font></td>
    </tr>
    <tr bgcolor="f5f5f5"> 
      <td width="25%"> <div align="right">论文作者：</div></td>
      <td width="75%"><s:textfield id="author" name="thesis.author" maxlength="20"/><font color="#FF0000">*</font></td>
    </tr>
    <tr bgcolor="f5f5f5"> 
      <td width="25%"> <div align="right">指导老师：</div></td>
      <td width="75%"><s:textfield id="tutor" name="thesis.tutor" maxlength="20"/></td>
    </tr>
    <tr bgcolor="f5f5f5"> 
      <td width="25%"> <div align="right">毕业年份：</div></td>
      <td width="75%"><s:textfield id="graduateYear" name="thesis.graduateYear" maxlength="4"/></td>
    </tr>
    <tr bgcolor="f5f5f5"> 
      <td width="25%"> <div align="right">论文类型：</div></td>
      <td width="75%"><s:radio id="thesisType" name="thesis.thesisType" list="#{'学士':'学士','硕士':'硕士','博士':'博士','博士后':'博士后'}" value="'硕士'"/></td>
    </tr>
    <tr bgcolor="f5f5f5"> 
      <td width="25%"> <div align="right">关键字：</div></td>
      <td width="75%"><s:textfield id="keyWords" name="thesis.keyWords" maxlength="100"/></td>
    </tr>
    <tr bgcolor="f5f5f5"> 
      <td width="25%"> <div align="right">摘要：</div></td>
      <td width="75%"><s:textarea id="thesisAbstract" name="thesis.thesisAbstract" cols="60" rows="8"></s:textarea></td>
    </tr>
    <tr bgcolor="f5f5f5"> 
      <td width="25%" valign="top"><div align="right">评审意见：</div></td>
      <td width="75%"><s:textarea id="reviewComments" name="thesis.reviewComments" cols="60" rows="8"></s:textarea></td>
	</tr>
    <tr bgcolor="f5f5f5"> 
      <td width="25%" valign="top"><div align="right">备注：</div></td>
      <td width="75%"><s:textarea id="note" name="thesis.note" cols="60" rows="2"></s:textarea></td>
	</tr>
    <tr bgcolor="f5f5f5"> 
        <td width="25%"> <div align="right">论文Word文档：</div></td>
        <td width="75%"><input type="file" name="word"></td>
     </tr>   
     
     
     <tr bgcolor="f5f5f5"> 
        <td width="25%"> <div align="right">论文PDF文档：</div></td>
        <td width="75%"><input type="file" name="pdf"></td>
     </tr>
     <tr bgcolor="f5f5f5"> 
        <td width="25%">&nbsp;&nbsp;</td>
        <td width="75%">&nbsp;&nbsp;</td>
     </tr>
    
    <tr bgcolor="f5f5f5"> 
      <td colspan="2"> <div align="center"> 
          <input type="button" class="frm_btn" value=" 提 交 " onclick="check()">
          &nbsp;&nbsp;<input type="button" name="Button" value=" 返 回 " class="frm_btn" onclick="javascript:history.back()">
        </div></td>
    </tr>
  </table>
</s:form>
  </body>
</html>
